package com.ytjj.qmyx.mall.controller;

import com.ytjj.common.api.CommonResult;
import com.ytjj.qmyx.mall.model.response.GoodsProductResponse;
import com.ytjj.qmyx.mall.service.ProductForumService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 *
 *  *
 **/
@RestController
@RequestMapping("/product/forum")
public class ProductForumController {

    @Resource
    private ProductForumService productForumService;

    @GetMapping("get")
    public CommonResult getProduct(@RequestParam(value = "pageNum", required = false) Integer pageNum,
                                   @RequestParam(value = "pageSize", required = false) Integer pageSize,
                                   @RequestParam String type) {
        List<GoodsProductResponse> list = productForumService.getProducts(pageNum,pageSize,type);
        return CommonResult.success(list);
    }
}
